import request from '@/utils/request'

export const categoryApi = {
  // 获取分类树
  getCategoryTree() {
    return request.get('/categories/tree')
  },
  
  // 获取所有分类
  getAllCategories() {
    return request.get('/categories')
  },
  
  // 添加分类
  addCategory(data) {
    return request.post('/categories', data)
  },
  
  // 更新分类
  updateCategory(id, data) {
    return request.put(`/categories/${id}`, data)
  },
  
  // 删除分类
  deleteCategory(id) {
    return request.delete(`/categories/${id}`)
  }
}

